package com.qfedu.demo;

import com.qfedu.config.SpringConfig;
import com.qfedu.pojo.Account;
import com.qfedu.service.AccountService;
import org.apache.commons.dbutils.QueryRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;


public class Demo01 {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfig.class);

        AccountService accountService = (AccountService) applicationContext.getBean("accountService", AccountService.class);

        List<Account> allAccount = accountService.findAllAccount();
        for (Account account : allAccount) {
            System.out.println(account);
        }
    }
}
